
<form class="well form-horizontal span8" action="<?php echo base_url() . "index.php/docente/actualizar" ?>" method="post" enctype="multipart/form-data" >
    <legend>MODIFICAR DATOS DEL DOCENTE</legend>
    <?php foreach ($docente as $i => $doc) { ?>
        <div class="tabbable">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#1" data-toggle="tab">Datos Generales</a></li>
                <li><a href="#2" data-toggle="tab">Datos Docentes</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="1">
                    <div class="control-group">
                        <label class="control-label" for="input01">N&uacute;mero de Identificaci&oacute;</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="cedula_pers" value= "<?php echo $doc['cedula_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('cedula_pers') ?>
                            </div>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select01">Tipo de Documento</label>
                        <div class="controls">

                            <select id="select01"  name="tipo_doc_pers">

                                <option value= "0" <?php echo ($doc['tipo_doc_pers'] == 0 ? " selected" : " "); ?>>CEDULA</option>
                                <option value= "1" <?php echo ($doc['tipo_doc_pers'] == 1 ? " selected" : " "); ?>>PASAPORTE</option>
                                <option value= "2" <?php echo ($doc['tipo_doc_pers'] == 2 ? " selected" : " "); ?>>CARNE DE REFUGIADO</option>
                            </select>

                        </div>
                    </div>


                    <div class="control-group">
                        <label class="control-label" for="input02">Nombre Completos</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="nombre_pers" value= "<?php echo $doc['nombre_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('nombre_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input03">Apellidos </label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="apellido_pers" value= "<?php echo $doc['apellido_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('apellido_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input04">Nacionalidad </label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="nacionalidad_pers" value= "<?php echo $doc['nacionalidad_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('nacionalidad_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input15">Provincia </label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="provincia_pers" value= "<?php echo $doc['provincia_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('provincia_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input05">Ciudad </label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="ciudad_pers" value= "<?php echo $doc['ciudad_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('ciudad_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input06">Direccion del Domicilio</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="direccion_pers" value= "<?php echo $doc['direccion_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('direccion_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input07">Referencia del Domicilio</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="refer_domic_pers" value= "<?php echo $doc['refer_domic_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">Tipo de Discapacidad</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="tipo_discap_pers" value= "<?php echo $doc['tipo_discap_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input09">Carn&eacute; del CONADIS</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="conadis_pers" value= "<?php echo $doc['conadis_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input010">Porcentaje de Discapacidad</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="porc_disc_pers" value= "<?php echo $doc['porc_disc_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select01">Sexo</label>
                        <div class="controls">

                            <select id="select01"  name="sexo_pers">
                                <option <?php echo ($doc['sexo_pers'] == "HOMBRE" ? " selected" : " "); ?>>HOMBRE</option>
                                <option <?php echo ($doc['sexo_pers'] == "MUJER" ? " selected" : " "); ?>>MUJER</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select02">Estado Civil</label>
                        <div class="controls">

                            <select id="select02"  name="estado_civil_pers">
                                <option <?php echo ($doc['estado_civil_pers'] == "SOLTERO(A)" ? " selected" : " "); ?>>SOLTERO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "CASADO(A)" ? " selected" : " "); ?>>CASADO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "UNION LIBRE" ? " selected" : " "); ?>>UNION LIBRE</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "DIVORCIADO(A)" ? " selected" : " "); ?>>DIVORCIADO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "VIUDO(A)" ? " selected" : " "); ?>>VIUDO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "ECLECIASTICO(A)" ? " selected" : " "); ?>>ECLECIASTICO(A)</option>


                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select12">Autodefinici&oacute;</label>
                        <div class="controls">

                            <select id="select02"  name="autodefin_pers">
                                <option <?php echo ($doc['autodefin_pers'] == "NEGRO" ? " selected" : " "); ?>>NEGRO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "MULATO" ? " selected" : " "); ?>>MULATO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "AFROECUATORIANO" ? " selected" : " "); ?>>AFROECUATORIANO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "INDIGENA" ? " selected" : " "); ?>>INDIGENA</option>
                                <option <?php echo ($doc['autodefin_pers'] == "MESTIZO" ? " selected" : " "); ?>>MESTIZO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "MONTUBIO" ? " selected" : " "); ?>>MONTUBIO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "BLANCO" ? " selected" : " "); ?>>BLANCO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "OTRO" ? " selected" : " "); ?>>OTRO</option>


                            </select>

                        </div>
                    </div>


                    <div class="control-group">
                        <label class="control-label" for="select03">Fecha de Nacimiento</label>
                        <div class="controls">
                            <input type="text" class="input-medium "  id="datepicker" name="fecha_nac_pers" value="<?php echo date("m/d/Y", strtotime($doc['fecha_nac_pers'])); ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">N&uacute;mero de tel&eacute;fono</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="fono_pers" value= "<?php echo $doc['fono_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input09">N&uacute;mero de celular</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="celular_pers" value= "<?php echo $doc['celular_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input10">Correo Electr&oacute;nico Institucional</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="email_inst_pers" value= "<?php echo $doc['email_inst_pers']; ?>">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input11">Fotograf&iacute;a</label>
                        <div class="controls">
                            <img src="<?php echo $doc['foto_pers']; ?>" width="88" height="99" alt="itss1"/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input11">Subir fotograf&iacute;a</label>
                        <div class="controls">
                            <input type="file" class="input-medium span4"  name="foto_pers" value= "<?php echo $doc['foto_pers']; ?>">

                        </div>
                    </div>

                </div>
                <div class="tab-pane" id="2">
                    <div class="control-group">
                        <label class="control-label" for="select03">Categor&iacute;a</label>
                        <div class="controls">

                            <select id="select01"  name="cat_escalofon_doc">
                                <option value="1" <?php echo (($doc["cat_escalofon_doc"] == 1 ? " selected" : "") . ""); ?>>PRINCIPAL</option>
                                <option value="2" <?php echo (($doc["cat_escalofon_doc"] == 2 ? " selected" : "") . ""); ?>>AGREGADO</option>
                                <option value="3" <?php echo (($doc["cat_escalofon_doc"] == 3 ? " selected" : "") . ""); ?>>INVITADO</option>

                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select04">Tipo de Relaci&oacute;n</label>
                        <div class="controls">

                            <select id="select02"  name="tipo_contrato_doc">

                                <option value="1" <?php echo (($doc["tipo_contrato_doc"] == 1 ? " selected" : "") . ""); ?>>CONTRATO</option>
                                <option value="2" <?php echo (($doc["tipo_contrato_doc"] == 2 ? " selected" : "") . ""); ?>>SERVICIOS PROFESIONALES</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select14">Concuso de Meritos</label>
                        <div class="controls">

                            <select id="select02"  name="concurso_doc">
                                <option value="0">SI</option>
                                <option value="1">NO</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select14">Dedicaci&oacute;n</label>
                        <div class="controls">

                            <select id="select02"  name="dedicacion_doc">
                                <option value="1">TIEMPO COMPLETO</option>
                                <option value="2">TIEMPO PARCIAL</option>
                                <option value="3">HORAS</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select15">Cursa Estudios</label>
                        <div class="controls">

                            <select id="select02"  name=""cursa_estudios_doc>
                                <option value="1">NINGUNO</option>
                                <option value="2">MAESTRIA</option>
                                <option value="3">DOCTORADO</option>
                            </select>

                        </div>
                    </div>      
                    <div class="control-group">
                        <label class="control-label" for="input05">Fecha Ingreso1</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker1" name="fecha_ingreso1_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_ingreso1_doc'])); ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input05">Fecha de Salida1</label>
                        <div class="controls">
                            <input type="text" class="input-medium "  id="datepicker2" name="fecha_salida1_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_salida1_doc'])); ?>">
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input06">Fecha de Ingreso2</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker3" name="fechaingeso2_doc" value="<?php echo date("m/d/Y", strtotime($doc['fechaingeso2_doc'])); ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input07">Fecha de Salida2</label>
                        <div class="controls">
                            <input type="text" class="input-medium "  id="datepicker4" name="fecha_salida2_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_salida2_doc'])); ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input08">Fecha de Ingreso3</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker5" name="fecha_ingreso3_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_ingreso3_doc'])); ?>">


                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">Fecha de Salida3</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker6" name="fecha_salida3_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_salida3_doc'])); ?>">


                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select07">Activo</label>
                        <input type="checkbox" name="activo_doc" value="1" <?php echo ($doc["activo_doc"] == 1 ? "checked='checked'" : ""); ?> />

                    </div>
                </div>
            </div>
        </div>
    <?php } ?>
    <?php if (isset($msj_error)) { ?>
        <div class='MensajeError'>
            <?php echo ($msj_error); ?>
        </div>
    <?php } ?>

    <fieldset>
        <div class="control-group"> 
            <div class="controls">
                <input type="hidden" name="persona_ide_pers" value="<?php echo $doc["persona_ide_pers"]; ?>">

            </div>
        </div >
    </fieldset>

    <fieldset>
        <div class="control-group"> 
            <div class="controls">
                <input type="hidden"  name="txtopc" value="<?php echo $opc; ?>">

            </div>
        </div >
    </fieldset>
    <div class="control-group"> 
        <div class="controls">
            <input type="hidden" name="foto_pers" value="<?php echo $doc["foto_pers"]; ?>">

        </div>
    </div >
</fieldset>


<div class="controls">
    <?php if ($opc == 'upd') { ?>
        <button type="submit" class="btn">Modificar Datos</button>

    <?php } else { ?>
        <button type="submit" class="btn">Eliminar Datos</button>
    <?php } ?>
    <a href="<?php echo base_url() . "index.php/docente/inicio" ?>">
        <img src="<?php echo base_url(); ?>commons/images/boton_volver.gif"></a>

</div> 



</form>

